// 导入axios
import instance from '@/http/index.js'

// 注册接口
export const register = data => {
    const { account, password } = data
    return instance({
        url: '/api/register',
        method: 'POST',
        data: { account, password }
    })
}
// 登录接口
export const login = data => {
    const { account, password } = data
    return instance({
        url: '/api/login',
        method: 'POST',
        data: { account, password }
    })
}
// 忘记密码验证接口
export const verify = data => {
    const { account, email } = data
    console.log(data);
    
    return instance({
        url: '/user/varityAccountAndEmail',
        method: 'POST',
        data: { account, email }
    })
}
// 密码重置接口
export const resetPassword = data => {
    const { id, newPassword } = data
    return instance({
        url: '/user/changePasswordLogin',
        method: 'POST',
        data: { id, newPassword }
    })
}